package com.jianggy.jsonpath;

import java.io.*;
import java.util.List;

/**
 * Hello world!
 */
public class App {
    public static final String SEPARATOR = "@@@&&&&&@@@";

    public static void main(String[] args) {
        try {
            InputStream inputStream = App.class.getResourceAsStream("/findStudentList.json");
            InputStreamReader reader = new InputStreamReader(inputStream);
            BufferedReader bufferedReader = new BufferedReader(reader);
            StringBuilder builder = new StringBuilder();
            String tmp;
            while ((tmp = bufferedReader.readLine()) != null) {
                builder.append(tmp);
            }
            String source = builder.toString();
            // List<String> list = new ArrayList<>();
            // String[] paths1 = new String[]{"store.storename", "store.book.title", "store.book.isbn", "store.book.price", "store.bicycle"};
            // String[] paths2 = new String[]{"title", "price", "isbn"};
            String[] paths3 = new String[]{"obj.id","obj.code","obj.name","obj.sex","obj.educationalSystem","obj.studentType","obj.identityCard","obj.nativePlace","obj.zipCode","obj.homeAddr","obj.ethnic","obj.birthDate","obj.enrolmentDate","obj.graduationDate","obj.grade","obj.status"};
            List<String> resList = JSONParse.parse(source,paths3);
            for (String s : resList) {
                System.out.println(s);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
